function s(){
	let lone = document.querySelectorAll(".list_x .lone")
	// console.log(lone)
	//总价
	let allcount = document.querySelector("#allcount")
	console.log(allcount)
	//先让总价等于0
	let allcountNum = 0

	for(let i = 0;i < lone.length;i++){
		// console.log(lone[i].children[2].children[0].innerHTML)
		var a = lone[i].children[2].children[0].innerHTML
		// console.log(lone[i].children[3].children[0].value)
		var b = lone[i].children[3].children[0].value
		// console.log(lone[i].children[4].children[0].innerHTML)
		var count = lone[i].children[4].children[0].innerHTML = (a * b).toFixed(2)
		// console.log(count)

		allcountNum += Number(count) 

	}
	//赋值总价
	allcount.innerHTML = allcountNum.toFixed(2)
}

s()


//修改数量
//获取input的数量
let ipt = document.querySelectorAll("#ipt")
console.log(ipt)
for(let j = 0;j < ipt.length;j++){
	ipt[j].addEventListener('change',s)
}


//删除
let del = document.querySelectorAll("#del")
// console.log(del)
for(let k = 0;k < del.length;k++){
	del[k].addEventListener('click',function(){
		// console.log(this.parentNode)
		var long = document.querySelector(".bottom .list_x")
		var longs = document.querySelector(".bottom .list_x .lone")
		console.log(long)
		long.removeChild(longs)
		s()
	})
}